package com.seecoder.BlueWhale.vo;

import com.seecoder.BlueWhale.enums.DeliveryMethodEnum;
import com.seecoder.BlueWhale.enums.OrderStatusEnum;
import com.seecoder.BlueWhale.po.Order;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Date;

@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class OrderVO {
    private Integer id;                          //订单编号

    private OrderStatusEnum status;                   //订单状态

    private Integer ownerID;                     //订单所有者的id

    private Integer storeID;                     //订单所属商店的id

    private Integer commodityID;                 //订单商品的id

    private String commodityName;                //订单商品名称

    private float price;                         //订单商品的价格

    private Integer quantity;                    //订单商品的数量

    private Date createTime;                     //创建时间

    private DeliveryMethodEnum deliveryMethod;   //送货方式

    public Order toPO(){
        Order order = new Order();
        order.setId(this.id);
        order.setStatus(this.status);
        order.setOwnerID(this.ownerID);
        order.setStoreID(this.storeID);
        order.setCommodityID(this.commodityID);
        order.setQuantity(this.quantity);
        order.setCreateTime(this.createTime);
        order.setDeliveryMethod(this.deliveryMethod);
        return order;
    }
}
